Gatsby Default StarterGatsby logo

#LinuxServer

to install

go to root on the linux server

  • apt install samba
  • systemctl enable smbd
  • systemctl status smbd
  • nano /etc/samba/smb.conf and do the configurations
  • in our case:
  • ![[Pasted image 20240328162709.png]]

creating users and groups

  • adduser agah
  • password: operations
  • smbpasswd -a agah
  • groupadd partage
  • gpasswd -a agah partage

create the shared folder for everyone to access

  • mkdir /srv/partage
  • chgrp -R partage /srv/partage/

- chmod -R g+rw /srv/partage to give the read and write rights to the partage shared folder

  • we can see the rights with ls -al /srv/

  • ![[Pasted image 20240328163003.png]]

  • now the file is created on the server.

  • we go to the windows client on the server but we put the network card on the VMnet2 for it to be on the same LAN with the server.

  • we login to the user account and go to windows explorer and go to \\srvlx01 and voilà we see the files !

  • ![[Pasted image 20240328163150.png]]

  • to add the shared files to the This PC :

  • we go to the windows client's terminal

  • net use u: \\srvlx01\user

  • net use p: \\srvlx01\partage

  • and the result is as following :

  • ![[Pasted image 20240328163755.png]]

  • if it doesn't work with srvlx01 we can put the IP address of the srvlx01 as well, in our case 192.168.3.101, because sometimes it doesn't work on Win11.

  • and to overcome this problem we need to activate the NetBIOS on TCP/IP in the IPv4 Advanced Settings as in the image following

  • ![[NetBIOS activation.png]]

Editing the user rights

  • we go back to the /home/user/smb.conf
  • and edit the rights like
  • ![[Pasted image 20240328162709.png]]
  • L'option "create mask" va permettre de définir les droits par défaut sur les

fichiers (lecture/écriture pour l'utilisateur propriétaire et le groupe propriétaire seulement)

  • L'option "directory mask" va permettre de définir les droits par défaut sur

les dossiers

  • L'option "force group" va permettre de forcer le groupe "partage" comme

groupe propriétaire des fichiers et dossiers

  • at the end we need to restart the service with systemctl restart smbd
  • and we need disable SMB1 because it's vulnerable. details are giving in the TP_Samba.